package com.example.controller;

import com.example.service.AsyncTaskService;
import com.example.task.AsyncTask;
import com.example.util.IpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping(value = "/async")
public class AsyncTaskController {

    @Autowired
    AsyncTaskService asyncTaskService;

    @GetMapping(value = "/showMsg")
    public String showMsg() throws InterruptedException {
        asyncTaskService.showMsg();
        return "SUCCESS";
    }

}
